<template>
    <div class="container" v-loading="loading">
        <div class="stu-header" transiton="fade">
            <el-form :inline="true" class="demo-form-inline filter_search" :model="searchForm" label-position="right"
                label-width="120px" ref="searchRules">
                <div>
                    <el-form-item class="nine-form-title" prop="subjectName" label="科目">
                        <span class="mtitle-color mtitle-font">{{searchForm.subjectName || '无'}}</span>
                    </el-form-item>
                    <el-form-item class="nine-form-title" prop="className" label="授课教师" v-if="searchForm.teacherType">
                        <span class="mtitle-color mtitle-font">{{searchForm.teacherName || '无'}}</span>
                    </el-form-item>
                    <el-form-item class="nine-form-title" prop="className" label="班级名称">
                        <span class="mtitle-color mtitle-font">{{searchForm.className || '无'}}</span>
                    </el-form-item>
                    <el-form-item class="nine-form-title" prop="testNameA" label="查询批次">
                        <span class="mtitle-color mtitle-font">{{dataList.testNameA || '无'}}</span>
                    </el-form-item>
                    <el-form-item class="nine-form-title" prop="testNameB" label="对比批次">
                        <span class="mtitle-color mtitle-font">{{dataList.testNameB || '无'}}</span>
                    </el-form-item>
                </div>
            </el-form>                 
        </div>
        <div class="con">
            <!-- 高三 -->
            <div v-if="searchForm.grade=='17'">
                <h3>1、上台阶</h3>
                <p class="page_title">班级上台阶率</p>
                <el-table
                    :data="dataList['topRateList']" border highlight-current-row
                    class="table student-down-table tabs tablePadding" ref="multipleTable" @sort-change="sortChange($event, dataList['topRateList'])"
                    :header-cell-style="{background: '#f1f1f1', color: '#333',borderColor: 'rgb(193 193 193)'}">
                    <template v-for="(item,index) in topRateColumns1" :key="'a'+index">
                        <el-table-column :label="item.name" :prop="item.props" align="right" header-align="center">
                            <template #default="scope">
                                <span v-if="index==2" :class="{'minus-number':String(scope.row[item.props]).replace('%','')<0, 'positive-number': String(scope.row[item.props]).replace('%','')>0}">
                                    {{scope.row[item.props]}}
                                </span>
                                <span v-else>{{scope.row[item.props]}}</span>
                                <template v-if="item.list && item.list.length">
                                    <template v-for="(itemSon, indexSon) in item.list" :key="'a'+indexSon">
                                        <el-table-column :label="itemSon.name" :prop="itemSon.props" align="right" header-align="center"></el-table-column>                                
                                    </template>
                                </template>
                            </template>                           
                        </el-table-column>
                    </template>
                </el-table>
                <p class="page_title">学生上台阶明细</p>
                <el-table
                    :data="dataList['topDetailList']" border highlight-current-row @sort-change="sortChange($event, dataList['topDetailList'])"
                    class="table student-down-table tabs tablePadding" ref="multipleTable" height="600"
                    :header-cell-style="{background: '#f1f1f1', color: '#333',borderColor: 'rgb(193 193 193)'}">
                    <template v-for="(item,index) in topDetailColumns2" :key="'b'+index">
                        <el-table-column :label="item.name" :prop="item.props" :align="item.align" :min-width="item.width? item.width: ''" :sortable="item.sortable? item.sortable: false" :sort-orders="item.sortOrders? item.sortOrders: []" header-align="center">
                            <template #default="scope">
                                <el-button v-if="index==2" type="text" class="idAddName" @click="changeStuInfo(scope.row)">{{scope.row[item.props]}}</el-button>
                                <span v-else>{{scope.row[item.props]}}</span>
                                <template v-if="item.list && item.list.length">
                                    <template v-for="(itemSon, indexSon) in item.list" :key="'b'+indexSon">
                                        <el-table-column :label="itemSon.name" :prop="itemSon.props" :min-width="item.width? item.width: ''" :sortable="itemSon.sortable? itemSon.sortable: false" :sort-orders="itemSon.sortOrders? itemSon.sortOrders: []" :align="itemSon.align" header-align="center"></el-table-column>                                
                                    </template>
                                </template>
                            </template>                           
                        </el-table-column>
                    </template>
                </el-table>
            </div>
            <!-- 高三或高一 -->
            <h3>{{searchForm.grade==17? '2' : '1'}}、城区位次数据</h3>
            <el-table
                :data="dataList['areaDataList']" border highlight-current-row @sort-change="sortChange($event, dataList['areaDataList'])"
                class="table student-down-table tabs tablePadding" ref="multipleTable" height="600"
                :header-cell-style="{background: '#f1f1f1', color: '#333',borderColor: 'rgb(193 193 193)'}">
                <template v-for="(item,index) in areaDataColumns3" :key="index">
                    <el-table-column :label="item.name" v-if="item.isShow" :prop="item.props" :align="item.align" :min-width="item.width? item.width: ''" :sortable="item.sortable? item.sortable: false" :sort-orders="item.sortOrders? item.sortOrders: []" header-align="center" :key="'b'+index">
                        <template #default="scope">
                            <el-button v-if="index==2" type="text" class="idAddName" @click="changeStuInfo(scope.row)">{{scope.row[item.props]}}</el-button>
                            <span v-else-if="index==3 || index==4 || index==5 ||index==6 || item.name=='百分比差值' || item.name =='位次差值'" :class="{'minus-number':String(scope.row[item.props]).replace('%','')<0, 'positive-number': String(scope.row[item.props]).replace('%','')>0}">
                                    {{scope.row[item.props]}}
                            </span>
                            <span v-else>{{scope.row[item.props]}}</span>
                             <template v-if="item.list && item.list.length">
                                <template v-for="(itemSon, indexSon) in item.list" :key="'b'+indexSon">
                                    <el-table-column :label="itemSon.name" :prop="itemSon.props" v-if="itemSon.isShow" :min-width="item.width? item.width: ''" :align="itemSon.align" :sortable="itemSon.sortable? itemSon.sortable: false" :sort-orders="itemSon.sortOrders? itemSon.sortOrders: []" header-align="center"></el-table-column>                                
                                </template>
                            </template>
                        </template>                       
                    </el-table-column>
                </template>
            </el-table>
            <h3>{{searchForm.grade==17? '3' : '2'}}、精华位次数据</h3>
            <el-table
                :data="dataList['areaDataList']" border highlight-current-row @sort-change="sortChange($event, dataList['areaDataList'])"
                class="table student-down-table tabs tablePadding" ref="multipleTable" height="600"
                :header-cell-style="{background: '#f1f1f1', color: '#333',borderColor: 'rgb(193 193 193)'}">
                <template v-for="(item,index) in areaDataColumns5" :key="index">
                    <el-table-column :label="item.name" v-if="item.isShow" :prop="item.props" :align="item.align" :min-width="item.width? item.width: ''" :sortable="item.sortable? item.sortable: false" :sort-orders="item.sortOrders? item.sortOrders: []" header-align="center" :key="'b'+index">
                        <template #default="scope">
                            <el-button v-if="index==2" type="text" class="idAddName" @click="changeStuInfo(scope.row)">{{scope.row[item.props]}}</el-button>
                            <span v-else-if="index==3 || index==4 || index==5 ||index==6 || item.name=='百分比差值' || item.name =='位次差值'" :class="{'minus-number':String(scope.row[item.props]).replace('%','')<0, 'positive-number': String(scope.row[item.props]).replace('%','')>0}">
                                    {{scope.row[item.props]}}
                            </span>
                            <span v-else>{{scope.row[item.props]}}</span>
                            <template v-if="item.list && item.list.length">
                                <template v-for="(itemSon, indexSon) in item.list" :key="'b'+indexSon">
                                    <el-table-column :label="itemSon.name" :prop="itemSon.props" v-if="itemSon.isShow" :min-width="item.width? item.width: ''" :align="itemSon.align" :sortable="itemSon.sortable? itemSon.sortable: false" :sort-orders="itemSon.sortOrders? itemSon.sortOrders: []" header-align="center"></el-table-column>                                
                                </template>
                            </template>
                        </template>                      
                    </el-table-column>
                </template>
            </el-table>
            <h3>{{searchForm.grade==17? '4' : '3'}}、{{isGao1 ? '标准分' : '偏差（平均值）'}}</h3>
            <el-table
                :data="dataList['deviAvgList']" border highlight-current-row @sort-change="sortChange($event, dataList['deviAvgList'])"
                class="table student-down-table tabs tablePadding" ref="multipleTable"  height="600"
                :header-cell-style="{background: '#f1f1f1', color: '#333',borderColor: 'rgb(193 193 193)'}">
                <template v-for="(item,index) in deviAvgColumn4" :key="index">
                    <el-table-column v-if="item.isShow" :label="item.name" :prop="item.props" :align="item.align" :min-width="item.width? item.width: ''" :sortable="item.sortable? item.sortable: false" :sort-orders="item.sortOrders? item.sortOrders: []" header-align="center" :key="'b'+index">
                        <template #default="scope">
                            <el-button v-if="index==2" type="text" class="idAddName" @click="changeStuInfo(scope.row)">{{scope.row[item.props]}}</el-button>
                            <span v-else-if="index==3" :class="{'minus-number':String(scope.row[item.props]).replace('%','')<0, 'positive-number': String(scope.row[item.props]).replace('%','')>0}">
                                    {{scope.row[item.props]}}
                            </span>
                            <span v-else>{{scope.row[item.props]}}</span>
                            <template v-if="item.list && item.list.length">
                                <template v-for="(itemSon, indexSon) in item.list" :key="'b'+indexSon">
                                    <el-table-column v-if="itemSon.isShow" :label="itemSon.name" :prop="itemSon.props" :min-width="item.width? item.width: ''" :align="itemSon.align" :sortable="itemSon.sortable? itemSon.sortable: false" :sort-orders="itemSon.sortOrders? itemSon.sortOrders: []" header-align="center"></el-table-column>                                
                                </template>
                            </template>
                        </template>
                    </el-table-column>
                </template>
            </el-table>
        </div>
    </div>
</template>
<script lang="ts" name="stuComDetails" setup>
import baseService from '@/service/baseService';
import { baseUrl } from '@/utils/api';
import {sort} from '@/utils/helper';
import { ref, reactive, onMounted, watch, nextTick, computed, getCurrentInstance } from 'vue';
import { useRoute, useRouter } from 'vue-router';
interface ItemList {
    name?: String,
    props?: String,
    align?: String,
    sortOrders?: string[],
    sortable?: String,
    isShow?: Boolean,
    width?: Number
}
interface Item {
    name?: String,
    props?: String,
    align?: String,
    sortOrders?: string[],
    sortable?: String,
    isShow?: Boolean,
    width?: Number,
    list?: ItemList[],
}

let searchForm = ref({});
let topRateColumns1 = ref<Item[]>([]);
let topDetailColumns2 = ref<Item[]>([]);
let areaDataColumns3 = ref<Item[]>([]);
let deviAvgColumn4 = ref<Item[]>([]);
let areaDataColumns5 = ref<Item[]>([]);
let dataList = ref({});
let loading = ref(false);
const { proxy } = getCurrentInstance();
const route = useRoute();
const router = useRouter();
const isGradeShow= computed(()=>{//是否高三
    return searchForm.value['grade']==17;
});
const isGao1= computed(()=>{//是否高一
    return searchForm.value['grade']== 11;
});
const isGao2= computed(()=>{//是否高二
    return searchForm.value['grade'] == 14;
});
onMounted(() => {
    getSessionSearch();      
});
let getSessionSearch= ()=>{
    if(JSON.stringify(route.params)!='{}'){
        searchForm.value = {...searchForm.value, ...route.params};
    }else{
        let search = JSON.parse(window.sessionStorage.getItem("vuex"))
        if(JSON.stringify(search.stuComDetails.routeParams)!='{}'){
            searchForm.value = {...searchForm.value, ...search.stuComDetails.routeParams}
        }
    }
    getColumns();
    getDataList();
};
let getColumns = ()=>{
    topRateColumns1.value = [//班级上台阶率表
        {name: '两次均考人数', props: 'bothNum'},
        {name: '有目标人数', props: 'targetNum'},
        {name: '差值', props: 'cz'},
        {
            name: '查询批次', 
            list: [
                {name: '上台阶人数', props: 'searchTopNum'},
                {name: '上台阶率', props: 'searchTopRate'},
            ]
        },
        {
            name: '对比批次',
            list: [
                {name: '上台阶人数', props: 'comTopNum'},
                {name: '上台阶率', props: 'comTopRate'},
            ]
        },
    ];
    
    topDetailColumns2.value= [
        {name: '序号', props: 'index', align: 'center'},
        {name: '学号', props: 'studentId', align: 'center', width: 90},
        {name: '学生姓名', props: 'studentName', align: 'center'},
        {name: '入学台阶参考批次', props: 'cktestName', align: 'center'},
        {name: '入学台阶', props: 'rxstepName', align: 'center'},
        {name: '高考目标台阶', props: 'inallName', align: 'center'},
        {
            name: '查询批次',
            list: [
                {name: `${searchForm.value['teacherType'] ? '得分' : '等级分'}`, props: 'searchDjf', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column'},
                {name: '台阶情况', props: 'searchSitu', align: 'center',sortOrders: ['ascending', 'descending'],sortable: 'column'},
                {name: '是否上台阶', props: 'searchIfTop', align: 'center',sortOrders: ['ascending', 'descending'],sortable: 'column'},
            ]
        },
        {
            name: '对比批次',
            list: [
                {name: `${searchForm.value['teacherType'] ? '得分' : '等级分'}`, props: 'comDjf', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column'},
                {name: '台阶情况', props: 'comSitu', align: 'center',sortOrders: ['ascending', 'descending'],sortable: 'column'},
                {name: '是否上台阶', props: 'comIfTop', align: 'center',sortOrders: ['ascending', 'descending'],sortable: 'column'},
            ]
        }
    ];
    areaDataColumns3.value = [
        {name: '序号', props: 'index', align: 'center',isShow: true},
        {name: '学号', props: 'studentId', align: 'center',isShow: true, width: 90},
        {name: '学生姓名', props: 'studentName', align: 'center',isShow: true},
        {name: '原始分百分比差值', props: 'ysfBfbCz', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
        {name: '原始分位次差值', props: 'ysfWcCz', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
        {name: '等级分百分比差值', props: 'djfBfbCz', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
        {name: '等级分位次差值', props: 'djfWcCz', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
        {name: '百分比差值', props: 'bfbCz', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: !isGradeShow || searchForm.value['teacherType']},
        {name: '位次差值', props: 'wccz', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: !isGradeShow || searchForm.value['teacherType']},
        {
            name: '查询批次',
            isShow: true,
            list: [
                {name: '原始分', props: 'searchYsf1',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
                {name: '得分', props: 'searchScore',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: !isGradeShow || searchForm.value['teacherType']},
                {name: '城区位次', props: 'searchAreaWc1',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: true},
                {name: '城区百分比', props: 'searchAreaBfb1',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: true},
                {name: '等级分', props: 'searchDjf2',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
                {name: '城区位次', props: 'searchAreaWc2',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
                {name: '城区百分比', props: 'searchAreaBfb2',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
            ]
        },
        {
            name: '对比批次',
            isShow: true,
            list: [
                {name: '原始分', props: 'comYsf1',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
                {name: '得分', props: 'comScore',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: !isGradeShow || searchForm.value['teacherType']},
                {name: '城区位次', props: 'comAreaWc1',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: true},
                {name: '城区百分比', props: 'comAreaBfb1',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: true},
                {name: '等级分', props: 'comDjf2',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
                {name: '城区位次', props: 'comAreaWc2',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
                {name: '城区百分比', props: 'comAreaBfb2',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
            ]
        }
    ];
    deviAvgColumn4.value = [
        {name: '序号', props: 'index',align: 'center',isShow: true},
        {name: '学号', props: 'studentId',align: 'center',isShow: true, width: 90},
        {name: '学生姓名', props: 'studentName',align: 'center',isShow: true},
        {name: '偏差差值', props: 'pccz',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column',isShow: !isGao1},
        {name: '标准分差值', props: 'pccz',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column',isShow: !!isGao1},
        {
            name: '查询批次',
            isShow: true,
            list: [
                {name: '原始分', props: 'searchYsf', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType'] },
                {name: '得分', props: 'searchYsf', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: !isGradeShow || searchForm.value['teacherType']},
                {name: '偏差', props: 'searchPc', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: !isGao1 || searchForm.value['teacherType']},
                {name: '标准分', props: 'searchPc', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGao1},
            ]
        },
        {
            name: '对比批次',
            isShow: true,
            list: [
                {name: '原始分', props: 'comYsf', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
                {name: '得分', props: 'comYsf', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: !isGradeShow || searchForm.value['teacherType']},
                {name: '偏差', props: 'comPc', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: !isGao1 || searchForm.value['teacherType']},
                {name: '标准分', props: 'comPc', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGao1},
            ]
        }
    ];
    areaDataColumns5.value = [
        {name: '序号', props: 'index', align: 'center',isShow: true},
        {name: '学号', props: 'studentId', align: 'center',isShow: true, width: 90},
        {name: '学生姓名', props: 'studentName', align: 'center',isShow: true},
        {name: '原始分百分比差值', props: 'ysfBfbCz', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
        {name: '原始分位次差值', props: 'ysfWcCz', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
        {name: '等级分百分比差值', props: 'djfBfbCz', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
        {name: '等级分位次差值', props: 'djfWcCz', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
        {name: '百分比差值', props: 'jhbfbCz', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: !isGradeShow || searchForm.value['teacherType']},
        {name: '位次差值', props: 'jhwccz', align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: !isGradeShow || searchForm.value['teacherType']},
        {
            name: '查询批次',
            isShow: true,
            list: [
                {name: '原始分', props: 'searchYsf1',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
                {name: '得分', props: 'searchScore',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: !isGradeShow || searchForm.value['teacherType']},
                {name: '精华位次', props: 'searchJhWc1',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: true},
                {name: '精华百分比', props: 'searchJhBfb1',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: true},
                {name: '等级分', props: 'searchDjf2',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
                {name: '精华位次', props: 'searchJhWc2',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
                {name: '精华百分比', props: 'searchJhBfb2',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
            ]
        },
        {
            name: '对比批次',
            isShow: true,
            list: [
                {name: '原始分', props: 'comYsf1',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
                {name: '得分', props: 'comScore',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: !isGradeShow || searchForm.value['teacherType']},
                {name: '精华位次', props: 'comJhWc1',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: true},
                {name: '精华百分比', props: 'comJhBfb1',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: true},
                {name: '等级分', props: 'comDjf2',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
                {name: '精华位次', props: 'comJhWc2',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
                {name: '精华百分比', props: 'comJhBfb2',align: 'right',sortOrders: ['ascending', 'descending'],sortable: 'column', isShow: isGradeShow && !searchForm.value['teacherType']},
            ]
        }
    ];
};
let getDataList =()=>{
    let _this = this;
    loading.value = true;
    let param = new URLSearchParams();
    param.append('yearly', searchForm.value['yearly'] || '');//考试批次ID
    param.append('grade', searchForm.value['grade'] || '');//班级ID
    param.append('testIdA', searchForm.value['testIdA']);//分数类型 0原始分 1等级分
    param.append('testIdB', searchForm.value['testIdB'] || '');//考试批次ID
    param.append('subjectId', searchForm.value['subjectId']);//分数类型 0原始分 1等级分
    param.append('noIncludelackTest', searchForm.value['noIncludelackTest'] || '');//分数类型 0原始分 1等级分
    if(searchForm.value['teacherType']){
        param.append('teacherType', '1');//如果是教师成绩分析 teacherType1 
        param.append('teacherId', searchForm.value['teacherId']);
    }else{
        param.append('classId', searchForm.value['classId'] || '');//班级ID
    }
    baseService.post(baseUrl+'/ft/score/analysis/classCompareDetail.do', param)
        .then(res => {
            loading.value = false;
            if(res.data.code !==0){
                proxy.$message.error(res.data.msg);
                return false;
            }
            dataList.value = res.data.data || {};

    
            // this.dataList={
            //     topRateList: [
            //         {bothNum: 15,targetNum: 15,cz: '6.25%', searchTopNum: 12, searchTopRate: '81.25%', comTopNum: 9, comTopRate: '75.00%'}
            //     ],
            //     topDetailList: [
            //         {index: 1,studentId: '12837220', studentName: '刘子玄',cktestName: '期中考试', rxstepName: '老二本', inallName: '一本线',searchDjf: '80.0',
            //             searchSitu: '老二本',searchIfTop: 0,comDjf:92.5,comSitu: '老二本',comIfTop: 0
            //         }
            //     ],
            //     areaDataList: [
            //         {index:1, studentId: '12837220', studentName: '刘子玄',ysfBfbCz: '-24.99%',ysfWcCz: -2668,djfBfbCz: '-24.99%',djfWcCz: -2668,
            //             searchYsf1: '80.0',searchAreaWc1: 9158,searchAreaBfb1: '90.55%',searchDjf2: '80.0',searchAreaWc2: 9158,searchAreaBfb2: '90.55%',
            //             comYsf1:92.5,comAreaWc1:6490,comAreaBfb1:'65.56%',comDjf2: 92.5,comAreaWc2: 6490, comAreaBfb2: '65.56%',bfbCz:'-24.99%',wccz: '-2668',searchScore:'80.0',comScore: 92.5
            //         }
            //     ],
            //     deviAvgList: [
            //         {index:1, studentId: '12837220', studentName: '刘子玄',pccz: '-9.13', searchYsf:'80.0',searchPc: '32.75',comYsf: '92.5',comPc: '46.38'}
            //     ]
            // }
    });    
};
/**
 * 表头排序
 */
let sortChange= (val, dataList)=>{ 
    let order="";
    sort(dataList, val.prop, val.order=='ascending');
};
    /**
 * 学生详情
 */
let changeStuInfo= (row)=>{//跳转路径页面
    let params ={
        customerId: row.customerId ||'',
        yearly: searchForm.value['yearly'] || '',
        classInfo : 1,
        studentId: row.studentId || '',
        grade: row.grade || searchForm.value['grade'] || '',
        index: true,
        paperType: row.paperType+"",
        subjectIds:row.subjectIds || '',
        testId:searchForm.value['testIdA'] || '',
        // isArtExam: row.isArtExam || '',
    }
    // let toRouteName = isGradeShow ? 'studentHomePage' : 'studentHomePage1'; 
    let toRouteName = 'studentHomePage1'; 
    let routeData = router.resolve({ 
        name: toRouteName
    });
    // if(isGradeShow){
    // }
    window.open(routeData.href +'?@pageFlag=stu', '_blank');
};
</script>
<style lang="scss" scoped>
h3{
    margin-top: 20px;
}
.page_title{
    font-size: 18px;
    margin: 20px 0px 20px 20px;
}
/* 负数 */
.minus-number{
    color: red;
}
.positive-number{
    color: #70B603;
}  
</style>